#! /bin/ash
#
echo "Running post-install"
#
mkdir -p /opt/var/named
mkdir -p /opt/var/run
#
# This hack seems to be necessary; I suspect that
# the IPK installer confuses the named executable & 
# the opt/etc/directory of the same name.
# The image IS in the data tarball of the kit.
#
#if [ ! -e /opt/sbin/named ]; then 
#    echo "Missing named, using redundant copy"
#    mv /opt/sbin/named.exe /opt/sbin/named 
#else
#    rm -f /opt/sbin/named.exe
#fi
#if [ -n "`/opt/bin/pidof named`" ]; then
#    /opt/bin/killall named 2>/dev/null
#fi

# Register for shutdown/halt

ln -sf /opt/etc/init.d/S09named /opt/etc/init.d/K91named

echo "You must now create your named.conf file"
echo "When it is installed in /opt/etc/named/named.conf, execute"
echo "              /opt/etc/init.d/S09named start"
echo "to start service"
echo "You will probably also want to create rndc.conf by running"
echo "rndc-confgen.  Of course, you may want to set your name server"
echo "in the GUI to 127.0.0.1 or your local ip-address"
